package com.zheng.rpc;

import com.zheng.rpc.api.HelloService;
import com.zheng.rpc.entities.Hello;
import com.zheng.rpc.entities.RpcServiceProperties;
import com.zheng.rpc.proxy.RpcClientProxy;
import com.zheng.rpc.remoting.transport.RpcRequestTransport;
import com.zheng.rpc.remoting.transport.socket.SocketRpcClient;

public class SocketClientMain {
    public static void main(String[] args) {
        RpcRequestTransport client = new SocketRpcClient();
        RpcServiceProperties properties = RpcServiceProperties.builder().group("test").version("v1.0").build();
        RpcClientProxy proxy = new RpcClientProxy(client, properties);
        HelloService helloService = proxy.getProxy(HelloService.class);
        String hello = helloService.hello(new Hello("hello", "hello world"));
        System.out.println(hello);
    }
}
